<?php
namespace App\Http\Controllers\Api;

use App\Repositories\Api\ContentRepository;

use Exception;

class ContentController extends MiniAppController
{
    private $contentRep;

    public function __construct(ContentRepository $contentRep)
    {
        parent::__construct();
        $this->contentRep = $contentRep;
    }

    public function list()
    {
        $params = request()->only("type", "limit");

        $res = $this->contentRep->getPages($params, $this->pageSize, $this->pageNum);

        return $this->apiResponse->success($res);
    }

    public function detail(){
        $params = request()->only("id");
        $res = $this->contentRep->getOne($params['id']);

        return $this->apiResponse->success($res);
    }

}